package ma.fizazi.missionsmanagement.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "TYPES_DEMANDES")
public class TypeDemande implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private int id;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column
	private String typeDemande;

	@OneToMany(mappedBy = "typeDemande", cascade = CascadeType.ALL)
	private List<EtapeDemande> etapeDemandes;

	@OneToMany(mappedBy = "typeDemande", cascade = CascadeType.ALL)
	private List<Demande> demandes;

	public TypeDemande() {

	}

	public void finalize() throws Throwable {

	}

	public String getTypeDemande() {
		return typeDemande;
	}

	public void setTypeDemande(String typeDemande) {
		this.typeDemande = typeDemande;
	}

	public List<EtapeDemande> getEtapeDemandes() {
		return etapeDemandes;
	}

	public void setEtapeDemandes(List<EtapeDemande> etapeDemandes) {
		this.etapeDemandes = etapeDemandes;
	}

	public List<Demande> getDemandes() {
		return demandes;
	}

	public void setDemandes(List<Demande> demandes) {
		this.demandes = demandes;
	}

}